

package com.bei_en.teacher.admin.controller.users;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bei_en.teacher.admin.model.users.bean.UsersDetails;
import com.bei_en.teacher.admin.model.users.condition.UsersDetailsCondition;
import com.bei_en.teacher.admin.model.users.vo.UsersDetailsVo;
import com.bei_en.teacher.admin.service.users.UsersDetailsService;
import com.bei_en.teacher.admin.controller.BaseController;
import com.bei_en.common.web.JsonFailResult;
import com.bei_en.common.web.JsonResult;
import com.bei_en.common.web.JsonSuccessResult;
import com.mysql.fabric.xmlrpc.base.Array;
/**
 * （个人资料）
 * @author Guocg
 * @date 2016-7-27 0:20:52
 */
@Controller
@RequestMapping("/api/UsersDetails")
public class UsersDetailsAPPController extends BaseController {

    @Autowired
    UsersDetailsService usersDetailsService;


    @RequestMapping("/usersDetails")
	@ResponseBody
    public JsonResult usersDetails(Model model,UsersDetailsCondition vo, BindingResult br, HttpSession session ) {

		List<UsersDetailsVo> list =new ArrayList<UsersDetailsVo>();
		   list = usersDetailsService.findUsersDetailsPage(vo);

	
		return new JsonSuccessResult(session.getId(), list);
    }

    @RequestMapping("/usersDetailsAdd")
    @ResponseBody
    public JsonResult usersDetailsAdd(Model model,UsersDetailsCondition vo, BindingResult br, HttpSession session) {
       	UsersDetailsVo usersDetails=new UsersDetailsVo();
	usersDetailsService.insert(usersDetails);
	return new JsonSuccessResult(session.getId(), new Array());
    }

    @RequestMapping("/usersDetailsEdit")
    public JsonResult usersDetailsEdit(Model model,UsersDetailsCondition vo, BindingResult br, HttpSession session) {
	
    	UsersDetailsVo usersDetails=new UsersDetailsVo();
	
		usersDetailsService.updateSelective(usersDetails);
	
		return new JsonSuccessResult(session.getId(), 	new Array());
    }

  
    
}
